﻿using System;
using System.Text;
class UpcaseTags
{
    static void Main()
    {
        string text = @"We are living in a <upcase>yellow submarine</upcase>. We don't have <upcase>anything</upcase> else.";

        int indexStart = 0;
        int indexEnd = 0;
        int lenght = 0;
        string startTag = "<upcase>";
        string endTag = "</upcase>";
        Console.WriteLine(text);
        Console.WriteLine();
        for (int i = 0; i < text.Length - 8; i++)
        {
            if (text.Substring(i, 8) == startTag)
            {
                indexStart = i + 8;
                i = indexStart;
            }
            if (text.Substring(i, 9) == endTag)
            {
                indexEnd = i; 
                lenght = indexEnd - indexStart;
                string upper = text.Substring(indexStart, lenght).ToUpper();
                text = text.Remove(indexStart, lenght);
                text = text.Insert(indexStart, upper);
                text = text.Remove(indexStart - 8, 8);
                text = text.Remove(indexEnd - 8, 9);
            }
        }
        Console.WriteLine(text);
        Console.ReadLine();
    }
}

